function calc_distance(point1, point2) {
    if (!point1 || !point2) return Infinity;

    let [x1, y1] = point1;
    let [x2, y2] = point2;
    let xx = Math.abs(x1 - x2);
    let yy = Math.abs(y1 - y2);
    let xy = Math.sqrt(Math.pow(xx, 2) + Math.pow(yy, 2));

    return xy;
}

export {calc_distance};